package com.atguigu.lease.web.app.controller.login;

public class LoginUserHolder {
    /*创建本地线程*/
    public static ThreadLocal<LoginUser> threadLocal = new ThreadLocal<>();

    /*获取本地线程资源*/
    public static LoginUser getLoginUser() {
        return threadLocal.get();
    }

    /*添加本地线程的资源*/
    public static void setThreadLocal(LoginUser loginUser) {
        threadLocal.set(loginUser);
    }

    /*清除线程占用的资源*/
    public static void clear() {
        threadLocal.remove();
    }
}
